
*------------------------------------------------------------------------------*
* Government position under unanimity rule
*
* Additional specs:
*	1. Excluding NONAs and parties with missing ideology
*	2. Fallback: 1st chamber median for expert governments
*
* Version:	2016-07-28
* Changes:	2016-??-??: First release
*------------------------------------------------------------------------------*


* Estimate utmost positions (excluding parties with missing ideology)
gen zsutmost = $ideology if p103 == 1 & $ideology != .

by g101 g105, sort: egen zsutmin = min(zsutmost)
by g101 g105, sort: egen zsutmax = max(zsutmost)


* Estimate position as midpoint
gen GOV_POS = zsutmin + (zsutmax - zsutmin)/2


* Fill in GOV_POS with fallback
replace GOV_POS = median1st if zsutmin == . & zsutmax == . & GOV_POS == .


* Cleansing
replace GOV_POS = . if g106 == 9

lab var GOV_POS "Position of government"

sort g101 g105 p101

capture: drop zsut* 
capture: erase zs.dta
capture: erase zs_median.dta
